package com.lhy.admin.common.secure.authorization;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public abstract class AbstractPermissionLogicalStrategy implements PermissionLogicalStrategy {

    @Override
    public boolean authorization(List<String> sessionPermissions, List<String> currentRequestPermissions, HttpServletRequest request) {
        return sessionPermissions != null && !sessionPermissions.isEmpty() && doAuthorization(sessionPermissions, currentRequestPermissions, request);
    }

    protected abstract boolean doAuthorization(List<String> sessionPermissions, List<String> currentRequestPermissions, HttpServletRequest request);
}
